package com.shun.media.config;

import com.shun.common.utils.ShunEnvUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;

/**
 * 配置API说明文档
 *
 * @author clever
 * @since 2021-09-27
 */
@Configuration
@EnableSwagger2WebMvc
public class Knife4jConfig {

    @Value("${biz.isApiDoc:true}")
    private boolean isApiDoc;

    @Bean(value = "apiDoc")
    public Docket apiDoc() {
        Docket docket = ShunEnvUtil.createDocket("SHUN-GJYD 媒体管理API 文档", "# 媒体管理API 说明文档",
                "com.shun.media.action",isApiDoc);
        return docket;
    }
}
